<?php include(APPLICATION_PATH.'modules/hm-news/views/scripts/common/navigation.phtml'); ?>
<h2 class="title">Categorias</h2>
<div class="prepend-top append-bottom">
	<form enctype="multipart/form-data" action="<?php echo $this->url(array('action'=>'add')); ?>" method="post">
		<div class="hide">
			<input type="hidden" name="id" id="id" value="" />
		</div>
		<div class="clear">
			<div class="span-2 append-bottom"><label for="name">Categoria:</label></div>
			<input type="text" name="name" tabindex="1" maxlength="255" class="span-6 append-bottom" />
		</div>
		<div class="clear"><input type="submit" tabindex="2" name="add" value="Cadastrar" /></div>
	</form>
</div>
<?php if($this->rowcount > 0) { ?>
<table>
	<thead>
		<tr class="box">
			<td>Categoria</td>
			<td></td>
		</tr>
	</thead>
	<tfooter></tfooter>
	<tbody>
		<?php foreach($this->list_category as $list_category) : ?>
			<tr>
				<td><?php echo $list_category['name']; ?></td>
				<td>
					<a href="<?= $this->url(array('action'=>'edit','category_id'=>$list_category['id'])) ?>">Editar</a> | <a href="<?= $this->url(array('action'=>'delete','category_id'=>$list_category['id'])) ?>">Excluir</a>
				</td>
			</tr>
		<?php endforeach; ?>
	</tbody>
</table>
<?php } else { ?>
	<div class="error prepend-top">Nenhum registro encontrado.</div>
<?php } ?>